package com.ruleengine.context;

import java.util.Iterator;

import com.ruleengine.instruction.Instruction;
import com.ruleengine.instruction.InstructionSet;

public interface IWorkflowConext extends Cloneable{

    //以List形式返回所有的工作流指令栈
    public InstructionSet getInstructionSet();
    
    //返回当前pc计数器指向的指令
    public Instruction getCurrentInstruction();
    
    //程序计数器
    public int getPcCount();
    public void setPcCount(int pcCount);
    public void addPcCount(int pcCount);

    //获取上下文中的属性
    public <T> IContextProperty<T> removeContextProperty(String key);
    public <T> IContextProperty<T> getContextProperty(String key);
    public <T> void setContextProperty(IContextProperty<T> property);

    //获取property的迭代器
    public Iterator<IContextProperty<?>> propertyIterator();
    
    //目标工作流服务
    public String getWorkflowId();

    //指令异常对象
    public Exception getExceptionCause();
    public void setExceptionCause(Exception cause);

    public Object clone() throws CloneNotSupportedException;
    
    //合并上下文
    public void combination(IWorkflowConext context);
}